// pages/my/my.js
// 语言包
var chi = require('../../utils/Chinese.js')
var eng = require("../../utils/English.js")
//获取应用实例
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    language: '',
    // 语言包对象
    content: '',
    // 个人信息
    my:{id:'',url:'../../img/my_03.png',name:'Fribbri'}
  },
  on: function () {
    let that = this
    this.setData({
      language: app.data.language
    })
    var lastLanuage = that.data.language
    if (lastLanuage == 'zh_CN') {
      that.setData({
        content: chi.content
      })
      wx.setNavigationBarTitle({
        title: '我的'
      })
    } else if (lastLanuage == 'zh_EN') {
      that.setData({
        content: eng.content
      })
      // 修改导航标题
      wx.setNavigationBarTitle({
        title: 'My'
      })
    }
  },
  // 跳转
  order:function(){
    app.data.currentTab=0
    wx.navigateTo({
      url: '../my_orders/my_orders',
    })
  },
  pay:function(){
    app.data.currentTab=1
    wx.navigateTo({
      url: '../my_orders/my_orders',
    })
  },
  goods:function(){
    app.data.currentTab=2
    wx.navigateTo({
      url: '../my_orders/my_orders',
    })
  },
  com:function(){
    app.data.currentTab=3
    wx.navigateTo({
      url: '../my_orders/my_orders',
    })
  },

  my_infor:function(){
    wx.navigateTo({
      url: '../my_infor/my_infor',
    })
  },
  my_add:function(){
    wx.navigateTo({
      url: '../my_add/my_add',
    })
  },
  my_service:function(){

  },
  my_about:function(){
    wx.navigateTo({
      url: '../about/about',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let that = this
    that.on()
    // -------------------------------
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    let that = this
    that.on()

    // -------------------------------
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})